home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / xpt / xpt.h < prev   
C/C++ Source or Header  |  1995-05-09  |  11KB  |  274 lines

  1. /**
  2.  *
  3.  * xpt -- An X Periodic Table
  4.  *
  5.  * xpt.h -- some necessary global variables, data types, and LOTS of info
  6.  *
  7.  * Written by Joel P. Lord 03/05/93
  8.  *
  9.  *    This software is available for free distribution,
  10.  * under the condition that this not be removed from the
  11.  * source code.
  12.  *
  13. **/
  14.  
  15. #include <X11/Intrinsic.h>
  16. #include <X11/StringDefs.h>
  17. #include <X11/Xaw/XawInit.h>
  18. #include <X11/Xaw/Simple.h>
  19. #include <X11/Xaw/Command.h>
  20. #include <X11/extensions/Xext.h>
  21. #include <X11/Xaw/Command.h>
  22. #include <X11/Xaw/Box.h>
  23. #include <X11/Xaw/Form.h>
  24. #include <X11/Xaw/Dialog.h>
  25. #include <X11/Xaw/Scrollbar.h>
  26. #include <X11/Xaw/List.h>
  27. #include <X11/Xaw/Label.h>
  28. #include "Xprogs.h"
  29. #include "fontlist.h"
  30. #include "version.h"
  31.  
  32. struct element_stats {
  33.   double        atomic_radius;
  34.   double        covalent_radius;
  35.   unsigned      atomic_number;
  36.   double        atomic_mass;
  37.   char          symbol[4];
  38.   double    boiling_pt;
  39.   double    melting_pt;
  40.   double    density;
  41.   double    atomic_volume;
  42.   char        name[14];
  43. };
  44.  
  45. #ifdef MAIN
  46.  
  47. Widget toplevel, MainW;
  48. int done;
  49. Colormap default_cmap;
  50. unsigned long red, white, slate_grey;
  51. XFontStruct *BigFont;
  52. GC BigGC;
  53.  
  54. struct element_stats p_table[] = {
  55. 0.79, 0.32,   1, 1.00794    , "H  ", 20.268, 14.025 , 0.0899 , 14.4 ,
  56.   "Hydrogen     ",
  57. 0.49, 0.93,   2, 4.002602   , "He ", 4.215 , 0.95   , 0.1787 , 0.0  ,
  58.   "Helium       ",
  59. 2.05, 1.23,   3, 6.941      , "Li ", 1615  , 453.7  , 0.53   , 13.10,
  60.   "Lithium      ",
  61. 1.40, 0.90,   4, 9.012182   , "Be ", 2745  , 1560.0 , 1.85   , 5.0  ,
  62.   "Beryllium    ",
  63. 1.17, 0.82,   5, 10.811     , "B  ", 4275  , 2300.0 , 2.34   , 4.6  ,
  64.   "Boron        ",
  65. 0.91, 0.77,   6, 12.011     , "C  ", 4470.0, 4100.0 , 2.62   , 4.58 ,
  66.   "Carbon       ",
  67. 0.75, 0.75,   7, 14.00674   , "N  ", 77.35 , 63.14  , 1.251  , 17.3 ,
  68.   "Nitrogen     ",
  69. 0.65, 0.73,   8, 15.9994    , "O  ", 90.18 , 50.35  , 1.429  , 14.0 ,
  70.   "Oxygen       ",
  71. 0.57, 0.72,   9, 18.9984032 , "F  ", 84.95 , 53.48  , 1.696  , 17.1 ,
  72.   "Fluorine     ",
  73. 0.51, 0.71,  10, 20.1797    , "Ne ", 27.096, 24.553 , 0.901  , 16.7 ,
  74.   "Neon         ",
  75. 2.23, 1.54,  11, 22.989768  , "Na ", 1156  , 371.0  , 0.97   , 23.7 ,
  76.   "Sodium       ",
  77. 1.72, 1.36,  12, 24.3050    , "Mg ", 1363  , 922    , 1.74   , 13.97,
  78.   "Magnesium    ",
  79. 1.82, 1.18,  13, 26.981539  , "Al ", 2793  , 933.25 , 2.70   , 10.0 ,
  80.   "Aluminum     ",
  81. 1.46, 1.11,  14, 28.0855    , "Si ", 3540.0, 1685   , 2.33   , 12.1 ,
  82.   "Silicon      ",
  83. 1.23, 1.06,  15, 30.97362   , "P  ", 550.0 , 317.30 , 1.82   , 17.0 ,
  84.   "Phosphorus   ",
  85. 1.09, 1.02,  16, 32.066     , "S  ", 717.75, 388.36 , 2.07   , 15.5 ,
  86.   "Sulfur       ",
  87. 0.97, 0.99,  17, 35.4527    , "Cl ", 239.1 , 172.16 , 3.17   , 22.7 ,
  88.   "Chlorine     ",
  89. 0.88, 0.98,  18, 39.948     , "Ar ", 87.30 , 83.81  , 1.784  , 28.5 ,
  90.   "Argon        ",
  91. 2.77, 2.03,  19, 39.0983    , "K  ", 1032  , 336.35 , 0.86   , 45.46,
  92.   "Potassium    ",
  93. 2.23, 1.91,  20, 40.078     , "Ca ", 1757  , 1112   , 1.55   , 29.9 ,
  94.   "Calcium      ",
  95. 2.09, 1.62,  21, 44.955910  , "Sc ", 3104  , 1812   , 3.0    , 15.0 ,
  96.   "Scandium     ",
  97. 2.00, 1.45,  22, 47.88      , "Ti ", 3562  , 1943   , 4.50   , 10.64,
  98.   "Titanium     ",
  99. 1.92, 1.34,  23, 50.9415    , "V  ", 3682  , 2175   , 5.8    , 8.78 ,
  100.   "Vanadium     ",
  101. 1.85, 1.18,  24, 51.9961    , "Cr ", 2945  , 2130.0 , 7.19   , 7.23 ,
  102.   "Chromium     ",
  103. 1.79, 1.17,  25, 54.93085   , "Mn ", 2335  , 1517   , 7.43   , 1.39 ,
  104.   "Manganese    ",
  105. 1.72, 1.17,  26, 55.847     , "Fe ", 3135  , 1809   , 7.86   , 7.1  ,
  106.   "Iron         ",
  107. 1.67, 1.16,  27, 58.93320   , "Co ", 3201  , 1768   , 8.90   , 6.7  ,
  108.   "Cobalt       ",
  109. 1.62, 1.15,  28, 58.69      , "Ni ", 3187  , 1726   , 8.90   , 6.59 ,
  110.   "Nickel       ",
  111. 1.57, 1.17,  29, 63.546     , "Cu ", 2836  , 1357.6 , 8.96   , 7.1  ,
  112.   "Copper       ",
  113. 1.53, 1.25,  30, 65.39      , "Zn ", 1180.0, 692.73 , 7.14   , 9.2  ,
  114.   "Zinc         ",
  115. 1.81, 1.26,  31, 69.723     , "Ga ", 2478  , 302.90 , 5.91   , 11.8 ,
  116.   "Gallium      ",
  117. 1.52, 1.22,  32, 72.61      , "Ge ", 3107  , 1210.4 , 5.32   , 13.6 ,
  118.   "Germanium    ",
  119. 1.33, 1.20,  33, 74.92159   , "As ", 876   , 1081   , 5.72   , 13.1 ,
  120.   "Arsenic      ",
  121. 1.22, 1.16,  34, 78.96      , "Se ", 958   , 494    , 4.80   , 16.45,
  122.   "Selenium     ",
  123. 1.12, 1.14,  35, 79.904     , "Br ", 332.25, 265.90 , 3.12   , 23.5 ,
  124.   "Bromine      ",
  125. 1.03, 1.12,  36, 83.80      , "Kr ", 119.80, 115.78 , 3.74   , 38.9 ,
  126.   "Krypton      ",
  127. 2.98, 2.16,  37, 85.4678    , "Rb ", 961   , 312.64 , 1.53   , 55.9 ,
  128.   "Rubidium     ",
  129. 2.45, 1.91,  38, 87.62      , "Sr ", 1650.0, 1041   , 2.6    , 33.7 ,
  130.   "Strontium    ",
  131. 2.27, 1.62,  39, 88.90585   , "Y  ", 3611  , 1799   , 4.5    , 19.8 ,
  132.   "Yttrium      ",
  133. 2.16, 1.45,  40, 91.224     , "Zr ", 4682  , 2125   , 6.49   , 14.1 ,
  134.   "Zirconium    ",
  135. 2.09, 1.34,  41, 92.90638   , "Nb ", 5017  , 2740.0 , 8.55   , 10.87,
  136.   "Niobium      ",
  137. 2.01, 1.30,  42, 95.94      , "Mo ", 4912  , 2890.0 , 10.2   , 9.4  ,
  138.   "Molybdenum   ",
  139. 1.95, 1.27,  43, 98         , "Tc ", 4538  , 2473   , 11.5   , 8.5  ,
  140.   "Technetium   ",
  141. 1.89, 1.25,  44, 101.07     , "Ru ", 4423  , 2523   , 12.2   , 8.3  ,
  142.   "Ruthenium    ",
  143. 1.83, 1.25,  45, 102.90550  , "Rh ", 3970.0, 2236   , 12.4   , 8.3  ,
  144.   "Rhodium      ",
  145. 1.79, 1.28,  46, 106.42     , "Pd ", 3237  , 1825   , 12.0   , 8.9  ,
  146.   "Palladium    ",
  147. 1.75, 1.34,  47, 107.8682   , "Ag ", 2436  , 1234   , 10.5   , 10.3 ,
  148.   "Silver       ",
  149. 1.71, 1.48,  48, 112.411    , "Cd ", 1040.0, 594.18 , 8.65   , 13.1 ,
  150.   "Cadmium      ",
  151. 2.00, 1.44,  49, 114.82     , "In ", 2346  , 429.76 , 7.31   , 15.7 ,
  152.   "Indium       ",
  153. 1.72, 1.41,  50, 118.710    , "Sn ", 2876  , 505.06 , 7.30   , 16.3 ,
  154.   "Tin          ",
  155. 1.53, 1.40,  51, 121.75     , "Sb ", 1860.0, 904    , 6.68   , 18.23,
  156.   "Antimony     ",
  157. 1.42, 1.36,  52, 127.60     , "Te ", 1261  , 722.65 , 6.24   , 20.5 ,
  158.   "Tellurium    ",
  159. 1.32, 1.33,  53, 126.90447  , "I  ", 458.4 , 386.7  , 4.92   , 25.74,
  160.   "Iodine       ",
  161. 1.24, 1.31,  54, 131.29     , "Xe ", 165.03, 161.36 , 5.89   , 37.3 ,
  162.   "Xenon        ",
  163. 3.34, 2.35,  55, 132.90543  , "Cs ", 944   , 301.55 , 1.87   , 71.07,
  164.   "Cesium       ",
  165. 2.78, 1.98,  56, 137.327    , "Ba ", 2171  , 1002   , 3.5    , 39.24,
  166.   "Barium       ",
  167. 2.74, 1.69,  57, 138.9055   , "La ", 3730.0, 1193   , 6.7    , 20.73,
  168.   "Lanthanum    ",
  169. 2.16, 1.44,  72, 178.49     , "Hf ", 4876  , 2500.0 , 13.1   , 13.6 ,
  170.   "Hafnium      ",
  171. 2.09, 1.34,  73, 180.9479   , "Ta ", 5731  , 3287   , 16.6   , 10.90,
  172.   "Tantalum     ",
  173. 2.02, 1.30,  74, 183.85     , "W  ", 5828  , 3680.0 , 19.3   , 9.53 ,
  174.   "Tungsten     ",
  175. 1.97, 1.28,  75, 186.207    , "Re ", 5869  , 3453   , 21.0   , 8.85 ,
  176.   "Rhenium      ",
  177. 1.92, 1.26,  76, 190.2      , "Os ", 5285  , 3300.0 , 22.4   , 8.49 ,
  178.   "Osmium       ",
  179. 1.87, 1.27,  77, 192.22     , "Ir ", 4701  , 2716   , 22.5   , 8.54 ,
  180.   "Iridium      ",
  181. 1.83, 1.30,  78, 195.08     , "Pt ", 4100.0, 2045   , 21.4   , 9.10 ,
  182.   "Platinum     ",
  183. 1.79, 1.34,  79, 196.96654  , "Au ", 3130.0, 1337.58, 19.3   , 10.2 ,
  184.   "Gold         ",
  185. 1.76, 1.49,  80, 200.59     , "Hg ", 630.0 , 234.28 , 13.53  , 14.82,
  186.   "Mercury      ",
  187. 2.08, 1.48,  81, 204.3833   , "Tl ", 1746  , 577    , 11.85  , 17.2 ,
  188.   "Thallium     ",
  189. 1.81, 1.47,  82, 207.2      , "Pb ", 2023  , 600.6  , 11.4   , 18.17,
  190.   "Lead         ",
  191. 1.63, 1.46,  83, 208.98037  , "Bi ", 1837  , 544.52 , 9.8    , 21.3 ,
  192.   "Bismuth      ",
  193. 1.53, 1.46,  84, 209        , "Po ", 1235  , 527    , 9.4    , 22.23,
  194.   "Polonium     ",
  195. 1.43, 1.45,  85, 210.0      , "At ", 610.0 , 575    , 0.0    , 0.0  ,
  196.   "Astatine     ",
  197. 1.34, 1.43,  86, 222        , "Rn ", 211   , 202    , 9.91   , 50.5 ,
  198.   "Radon        ",
  199. 3.50, 2.50,  87, 223        , "Fr ", 950.0 , 300.0  , 0.0    , 0.0  ,
  200.   "Francium     ",
  201. 3.00, 2.40,  88, 226.025    , "Ra ", 1809  , 973    , 5      , 45.20,
  202.   "Radium       ",
  203. 3.20, 2.20,  89, 227.028    , "Ac ", 3473  , 1323   , 10.07  , 22.54,
  204.   "Actinium     ",
  205. 2.70, 1.65,  58, 140.115    , "Ce ", 3699  , 1071   , 6.78   , 20.67,
  206.   "Cerium       ",
  207. 2.67, 1.65,  59, 140.90765  , "Pr ", 3785  , 1204   , 6.77   , 20.8 ,
  208.   "Praseodymium ",
  209. 2.64, 1.64,  60, 144.24     , "Nd ", 3341  , 1289   , 7.00   , 20.6 ,
  210.   "Neodymium    ",
  211. 2.62, 1.63,  61, 145        , "Pm ", 3785  , 1204   , 6.475  , 22.39,
  212.   "Promethium   ",
  213. 2.59, 1.62,  62, 150.36     , "Sm ", 2064  , 1345   , 7.54   , 19.95,
  214.   "Samarium     ",
  215. 2.56, 1.85,  63, 151.965    , "Eu ", 1870.0, 1090.0 , 5.26   , 28.9 ,
  216.   "Europium     ",
  217. 2.54, 1.61,  64, 157.25     , "Gd ", 3539  , 1585   , 7.89   , 19.9 ,
  218.   "Gadolinium   ",
  219. 2.51, 1.59,  65, 158.92534  , "Tb ", 3496  , 1630.0 , 8.27   , 19.2 ,
  220.   "Terbium      ",
  221. 2.49, 1.59,  66, 162.50     , "Dy ", 2835  , 1682   , 8.54   , 19.0 ,
  222.   "Dysprosium   ",
  223. 2.47, 1.58,  67, 164.93032  , "Ho ", 2968  , 1743   , 8.80   , 18.7 ,
  224.   "Holmium      ",
  225. 2.45, 1.57,  68, 167.26     , "Er ", 3136  , 1795   , 9.05   , 18.4 ,
  226.   "Erbium       ",
  227. 2.42, 1.56,  69, 168.93421  , "Tm ", 2220.0, 1818   , 9.33   , 18.1 ,
  228.   "Thulium      ",
  229. 2.40, 1.74,  70, 173.04     , "Yb ", 1467  , 1097   , 6.98   , 24.79,
  230.   "Ytterbium    ",
  231. 2.25, 1.56,  71, 174.967    , "Lu ", 3668  , 1936   , 9.84   , 17.78,
  232.   "Lutetium     ",
  233. 3.16, 1.65,  90, 232.0381   , "Th ", 5061  , 2028   , 11.7   , 19.9 ,
  234.   "Thorium      ",
  235. 3.14, 0.0 ,  91, 231.03588  , "Pa ", 0.0   , 0.0    , 15.4   , 15.0 ,
  236.   "Protactinium ",
  237. 3.11, 1.42,  92, 238.0289   , "U  ", 4407  , 1405   , 18.90  , 12.59,
  238.   "Uranium      ",
  239. 3.08, 0.0 ,  93, 237.048    , "Np ", 0.0   , 910.0  , 20.4   , 11.62,
  240.   "Neptunium    ",
  241. 3.05, 0.0 ,  94, 244        , "Pu ", 3503  , 913    , 19.8   , 12.32,
  242.   "Plutonium    ",
  243. 3.02, 0.0 ,  95, 243        , "Am ", 2880.0, 1268   , 13.6   , 17.86,
  244.   "Americium    ",
  245. 2.99, 0.0 ,  96, 247        , "Cm ", 0.0   , 1340.0 , 13.511 , 18.28,
  246.   "Curium       ",
  247. 2.97, 0.0 ,  97, 247        , "Bk ", 0.0   , 0.0    , 0.0    , 0.0  ,
  248.   "Berkelium    ",
  249. 2.95, 0.0 ,  98, 251        , "Cf ", 0.0   , 900.0  , 0.0    , 0.0  ,
  250.   "Californium  ",
  251. 2.92, 0.0 ,  99, 252        , "Es ", 0.0   , 0.0    , 0.0    , 0.0  ,
  252.   "Einsteinium  ",
  253. 2.90, 0.0 , 100, 257        , "Fm ", 0.0   , 0.0    , 0.0    , 0.0  ,
  254.   "Fermium      ",
  255. 2.87, 0.0 , 101, 258        , "Md ", 0.0   , 0.0    , 0.0    , 0.0  ,
  256.   "Mendelevium  ",
  257. 2.85, 0.0 , 102, 259        , "No ", 0.0   , 0.0    , 0.0    , 0.0  ,
  258.   "Nobelium     ",
  259. 2.82, 0.0 , 103, 260.0      , "Lr ", 0.0   , 0.0    , 0.0    , 0.0  ,
  260.   "Lawrencium   "
  261. };
  262.  
  263. #else
  264.  
  265. extern Widget toplevel, MainW;
  266. extern Colormap default_cmap;
  267. extern unsigned long red, white, slate_grey;
  268. extern struct element_stats p_table[];
  269. extern int done;
  270. extern XFontStruct *BigFont;
  271. extern GC BigGC;
  272.  
  273. #endif
  274.